"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCommitlintConfig = exports.getPrettierConfig = exports.getStylelintConfig = exports.getESLintConfig = exports.commitlint = exports.prettier = exports.stylelint = exports.eslint = void 0;
var lodash_1 = require("lodash");
var path = require("path");
var requireAll = require("require-all");
exports.eslint = requireAll({
    dirname: path.resolve(__dirname, "config/eslint"),
});
exports.stylelint = requireAll({
    dirname: path.resolve(__dirname, "config/stylelint"),
});
exports.prettier = requireAll({
    dirname: path.resolve(__dirname, "config/prettier"),
});
exports.commitlint = requireAll({
    dirname: path.resolve(__dirname, "config/commitlint"),
});
var getConfig = function (configs, rule, customConfig) {
    if (!configs[rule]) {
        throw new Error("Rule '".concat(rule, "' not Support!"));
    }
    return (0, lodash_1.merge)(configs[rule], customConfig || {});
};
// ESLint
var getESLintConfig = function (rule, customConfig) {
    return getConfig(exports.eslint, rule, customConfig);
};
exports.getESLintConfig = getESLintConfig;
// stylelint
var getStylelintConfig = function (rule, customConfig) {
    return getConfig(exports.stylelint, rule, customConfig);
};
exports.getStylelintConfig = getStylelintConfig;
// prettier
var getPrettierConfig = function (rule, customConfig) {
    return getConfig(exports.prettier, rule, customConfig);
};
exports.getPrettierConfig = getPrettierConfig;
// commitlint
var getCommitlintConfig = function (rule, customConfig) {
    return getConfig(exports.commitlint, rule, customConfig);
};
exports.getCommitlintConfig = getCommitlintConfig;
